<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Index</title>
    </h:head>
    <h:body>
        <h:form>
            <a href="./player/prova.faces"> Gioca </a>
            <p>oppure</p> 
            <a href="./admin/admin.faces"> Accedi come amministratore </a>

            <table>
                <tr>
                    <td><h:outputText value="username"/></td>
                    <td><h:inputText id="username-input" label="username" value="#{signUpController.username}" required="true" requiredMessage="campo obbligatorio"/></td>    
                    <td><h:message for="username-input"/></td>
                </tr>
                <tr>
                    <td><h:outputText value="password"/></td>
                    <td><h:inputSecret id="password-input" label="password" binding="#{passwordComponent}" value="#{signUpController.password}" required="true" requiredMessage="campo obbligatorio"/></td>    
                    <td><h:message for="password-input"/></td>
                </tr>
                <tr>
                    <td><h:outputText value="repeat password"/></td>
                    <td><h:inputSecret id="rpassword-input" label="repeat password" value="#{signUpController.rpassword}" required="true" requiredMessage="campo obbligatorio">
                            <f:validator validatorId="confirmPasswordValidator" />
                            <f:attribute name="passwordComponent" value="#{passwordComponent}" />
                        </h:inputSecret>

                    </td>    
                    <td><h:message for="rpassword-input"/></td>
                </tr>
                <tr>
                    <td><h:outputText value="email"/></td>
                    <td><h:inputText id="email-input" label="email" value="#{signUpController.email}" required="true" requiredMessage="campo obbligatorio"/></td>    
                    <td><h:message for="email-input"/></td>
                </tr>
                <tr>
                    <td><h:outputText value="repeat email"/></td>
                    <td><h:inputText id="remail-input" label="repeat email" value="#{signUpController.remail}" required="true" requiredMessage="campo obbligatorio"/></td>    
                    <td><h:message for="remail-input"/></td>
                </tr>
            </table>     
            <h:commandButton value="Registra" action="#{signUpController.signUp()}"/>    
        </h:form>
    </h:body>
</html>

